Namespaces

Functions

string|Translator
__(string $key, array $data = [], bool $choose = false)

Translate a key.

abort(int $code = 500, string $message = '')

Abort bow execution

Response|null
abort_if(bool $boolean, int $code, string $message = '')

Abort bow execution if condiction is true

add_event($event, $fn)

Alias de la class Event::on

add_event_once($event, $fn)

Alias de la class Event::once

add_transmisson_event(string $event, array|string $fn)

Alias de la class Event::once

mixed
app(string|null $key = null, array $setting = [])

Resolve the service container, or a binding out of it.

app_abort(int $code = 500, string $message = '')

Abort the request with an HTTP error.

Response|null
app_abort_if(bool $boolean, int $code, string $message = '')

Abort the request only when the given condition is true.

string
app_assets(string $filename)

Build a public URL for an asset under the asset prefix.

app_auth(string|null $guard = null)

Get the auth manager, or a specific guard.

app_db(string|null $name = null, callable|null $cb = null)

Get the database manager, optionally on another connection.

void
app_db_commit()

Commit the current database transaction.

int
app_db_delete(string $sql, array $data = [])

Run a raw DELETE query.

int
app_db_insert(string $sql, array $data = [])

Run a raw INSERT query.

void
app_db_rollback()

Roll back the current database transaction.

int|array
app_db_seed(string $name, array $data = [])

Seed data programmatically.

array|int|stdClass
app_db_select(string $sql, array $data = [])

Run a raw SELECT query.

array|int|StdClass
app_db_select_one(string $sql, array $data = [])

Run a raw SELECT query and return a single row.

int
app_db_statement(string $sql)

Run a schema/DDL statement (CREATE, ALTER, RENAME, DROP, ...).

app_db_table(string $name, string|null $connexion = null)

Get a query builder for a table (optionally on another connection).

void
app_db_transaction()

Begin a database transaction.

bool
app_db_transaction_started()

Check whether a database transaction is currently open.

int
app_db_update(string $sql, array $data = [])

Run a raw UPDATE query.

app_email(string|null $view = null, array|null $data = [], callable|null $cb = null)

Send an email, or get the mailer instance.

string|null
app_env(string $key, mixed $default = null)

Read an environment variable.

mixed
app_event()

Get the event dispatcher, or emit an event.

mixed
app_flash(string $key, string $message)

Store a one-request flash message in the session.

bool|string
app_hash(string $data, string|null $hash_value = null)

Hash a value, or verify one against an existing hash.

bool
app_in_debug()

Determine whether debug mode (APP_DEBUG) is enabled.

Logger
app_logger()

Get the application logger.

string
app_mode()

Get the current application environment (lower-cased APP_ENV).

Carbon
app_now()

Get the current time as a Carbon instance.

app_storage(string $disk)

Get a local filesystem disk.

string|Translator
app_trans(string|null $key = null, array $data = [], bool $choose = false)

Translate a key, or get the translator instance.

auth(string|null $guard = null)
deprecated

Get the auth manager, or a specific guard.

back(int $status = 302)

Make redirection to back

mixed
bhash(string $data, mixed $hash_value = null)

Alias sur la class Hash.

bool|string
bow_hash(string $data, string|null $hash_value = null)
deprecated

Hash a value, or verify one against an existing hash.

mixed
cache(string|null $key = null, mixed $value = null, int|null $ttl = null)

Get the cache instance, or read/write a cache entry.

string|null
client_locale()

Get the client's preferred request language.

collect(array $data = [])

Wrap an array in a Collection.

mixed
config(string|null $key = null, mixed $setting = null)

Read or write application configuration.

array|null
create_csrf_token(int|null $time = null)

Create (or fetch) the current CSRF token payload.

string
csrf_field()

Get the ready-made hidden CSRF input field.

string
csrf_time_is_expirate(string $time = null)

csrf, fonction permetant de générer un token

bool
csrf_time_is_expired(string|null $time = null)

Check whether the stored CSRF token has expired.

string
csrf_token()

Get the current CSRF token string.

array|null
curl(string $method, string $url, array $params = [], bool $return = false, string $header = null)

Curl help

db($name = null, callable $cb = null)

Allows to connect to another database and return the instance of the DB

void
db_commit()

Commit request after transaction

int
db_delete(string $sql, array $data = [])

Launches DELETE type SQL queries

int
db_insert(string $sql, array $data = [])

Launches INSERT SQL Queries

void
db_rollback()

Stop database transaction

void
db_seed(string $entry, array $data = [])

Make programmatic seeding

int|array|stdClass
db_select(string $sql, array $data = [])

Launches SELECT SQL Queries

int|array|StdClass
db_select_one(string $sql, array $data = [])

Launches SELECT SQL Queries

int
db_statement(string $sql)

Launches CREATE TABLE, ALTER TABLE, RENAME, DROP TABLE SQL Query

db_transaction(callable $cb = null)

Start Database transaction

bool
db_transaction_started()

Check if database transaction

int
db_update(string $sql, array $data = [])

Launches UPDATE SQL Queries

void
debug()

Dump one or more variables with colourised, typed output.

string|bool
decrypt(string $data)

Decrypt a value previously produced by encrypt().

int
delete(string $sql, array $data = [])

statement lance des requete SQL de type DELETE

string
download(string $file, null|string $filename = null, string $disposition = 'attachment', array $headers = [])

Download file

string
e(string|null $value = null)

Escape HTML special characters in a string.

email(string|null $view = null, array|null $data = [], callable|null $cb = null)

Send an email, or get the mailer instance.

void
emit_event(string $event)

Fire event

emitter()

Event emitter

string
encrypt(string $data)

Encrypt data using the application security key.

string
env(mixed $key, mixed $default = null)

Gets the app environement variable

mixed
event()

Get the event dispatcher, or emit an event.

mixed
faker(string $type = null)

Alias sur la class Filler.

MountFilesystem
file_system(string $mount)

Alias on the mount method

mixed
flash(string $key, string $message)

Store a one-request flash message in the session.

array
format_validation_errors(array $errors)

Formate validation erreur.

ftp()

Ftp Service loader

string
gen_csrf_token()

Generate a fresh, standalone token string (not stored in the session).

string|null
get_header(string $key)

Get http header

int
get_last_insert_id(string|null $name = null)

Returns the last ID following an INSERT query on a table whose ID is auto_increment.

string|null
get_response_header(string $key)

Read a header from the incoming request.

int
insert(string $sql, array $data = [])

insert lance des requete SQL de type INSERT

is_alpha($string)

Check if the string is alpha

is_alpha_num($slug)

Check if string is alpha numeric

bool
is_blank(mixed $value)

Determine if the given value is "blank".

is_domain($domain)

Check if the string is domain

bool
is_lower(string $string)

Check if the string is lower

bool
is_mail(string $email)

Check if the email is valid

is_slug($slug)

Check if string is slug

bool
is_upper(string $string)

Check if the string is upper

mixed
json(mixed $data, int $code = 200, array $headers = [])

Make json response

int
last_insert_id(string $name = null)

Retourne le dernier ID suite a une requete INSERT sur un table dont ID est auto_increment.

listen_event(string $event, callable|array|string $fn)

Add event

listen_event_once(string $event, callable|array|string $fn)

Add once event

bool
log(string $level, string $message, array $context = [])

Log error message

Logger
logger()

Get the application logger.

string
method_field(string $method)

Build a hidden input that spoofs the HTTP method (PUT, PATCH, DELETE).

MountFilesystem
mount(string $mount)

Alias on the mount method

mixed
old(string $key, mixed $fullback = null)

Get a value submitted on the previous request.

PDO
pdo()

Get the underlying PDO instance.

void
queue(QueueTask $producer)

Push a task onto the queue.

bool
raw_email(string $to, string $subject, string $message, array $headers = [])

Send a plain (non-templated) email.

redirect(string|null $path = null)

Get the redirector, optionally redirecting straight to a path.

redirect_back(int $status = 302)

Redirect to the previous page.

request()

Get the shared Request instance from the container.

response()

Get the shared Response instance from the container.

string
response_download(string $file, string|null $filename = null, array $headers = [])

Send a file as a download response.

string
response_json(array|object $data, int $code = 200, array $headers = [])

Send a JSON response.

string
route(string $name, bool|array $data = [], bool $absolute = false)

Build a URL for a named route.

s3()

S3 Service loader

mixed
sanitaze(mixed $data)

sanitaze, épure un variable d'information indésiration eg. sanitaze('j\'ai') => j'ai

mixed
sanitize(mixed $data)

Sanitize a value (numeric values are returned untouched).

mixed
secure(mixed $data)

Sanitize a value in strict/secure mode (numeric values pass through).

int|array|StdClass
select(string $sql, array $data = [])

statement lance des requete SQL de type SELECT

int|array|StdClass
select_one(string $sql, array $data = [])

statement lance des requete SQL de type SELECT

mixed
send(string $data)

Send simple message to client

string
sep()

Get the OS-specific directory separator.

mixed
session(string|null $key = null, mixed $default = null)

Get the session manager, or read a session value.

void
set_header(string $key, string $value)

Update http headers

PDO
set_pdo(PDO $pdo)

Replace the underlying PDO instance.

void
set_response_header(string $key, string $value)

Add a header to the outgoing response.

mixed
set_response_status_code(int $code)

Set the HTTP response status code.

mixed
set_status_code(int $code)

Set status code

string
slugify(string $str, string $sep = '-')

slugify, transforme un chaine de caractère en slug eg. la chaine '58 comprendre bow framework' -> '58-comprendre-bow-framework'

int
statement(string $sql)

statement lance des requete SQL de type CREATE TABLE|ALTER TABLE|RENAME|DROP TABLE

mixed
status_code(int $code)

statuscode, permet de changer le code de la reponse du server

storage_service(string $service)

Resolve a remote storage service (FTP, S3, ...).

Str
str()

Alis for \Bow\Support\Str class

string
str_camel(string $slug)

Convert a string to camelCase.

string
str_capitalize(string $slug)

Capitalise a string.

bool
str_contains(string $search, string $string)

Check whether a string contains another string.

string
str_fix_utf8(string $string)

Repair a malformed UTF-8 string.

void
str_force_in_utf8()

Force string output to UTF-8 globally.

bool
str_is_alpha(string $string)

Check whether a string contains only alphabetic characters.

bool
str_is_alpha_num(string $slug)

Check whether a string is alphanumeric.

bool
str_is_domain(string $domain)

Check whether a string is a valid domain name.

bool
str_is_lower(string $string)

Check whether a string is entirely lower-case.

bool
str_is_mail(string $email)

Check whether a string is a valid email address.

string
str_is_slug(string $slug)

Check whether a string is a valid slug.

bool
str_is_upper(string $string)

Check whether a string is entirely upper-case.

string
str_plural(string $slug)

Pluralise a word.

string
str_plurial(string $slug)

Transform text to plurial

string
str_random(string $string)

Generate a random string.

string
str_shuffle_words(string $words)

Randomly shuffle the words of a string.

string
str_slug(string $str, string $sep = '-')

Convert a string into a URL-friendly slug.

string
str_snake(string $slug)

Convert a string to snake_case.

string
str_uuid()

Generate a UUID string.

array
str_wordify(string $words, string $sep = '')

Check if string is slug

array
str_wordily(string $words, string $sep = '')

Split a string into an array of its words.

string|Translator
t(string $key, array $data = [], bool $choose = false)

Translate a key.

table(string $name, string|null $connexion = null)
deprecated

Get a query builder for a table (optionally on another connection).

string|Translator
trans(string $key = null, array $data = [], bool $choose = false)

Make translation

int
update(string $sql, array $data = [])

update lance des requete SQL de type UPDATE

string
url(string|array $url = '', array $parameters = [])

Build an absolute URL from the current request base.

validator(array $inputs, array $rules, array $messages = [])

Validate input against a set of rules.

bool
verify_csrf(string $token, bool $strict = false)

Verify a submitted CSRF token against the stored one.

view(string $template, int|array $data = [], int $code = 200)

Render a view template through View::parse().